<?php
include 'rfq_check.php';
if ($_POST) {
    include 'rfq_do.php';
    include '../business/rfq_made_manager.php';
    include_once '../entity/rfq_made_entity.php';

    $rfqMadeMng = new RFQMadeMng();
    $rfqMadeEntity = new RFQMadeEntity();

    $rfqMadeEntity->id = "-1";
    $rfqMadeEntity->rfqID = $rfqID;
    $rfqMadeEntity->plasticType = $_POST['sl_plasticType'];
    $rfqMadeEntity->polymer = $_POST['txt_polymer'];
    $rfqMadeEntity->supplier = $_POST['txt_supplier'];
    $rfqMadeEntity->likeModule = $_POST['rd_likeModule'] == 1 ? true : false;
    $rfqMadeEntity->percentage = $_POST['txt_percentage'];
    $rfqMadeEntity->inTime = time();
    $rfqMadeEntity->inUser = $_SESSION['userID'];

    if ($rfqMadeMng->update($madeEntity)) {
        echo "<script>window.location.href='rfq_submit.php'</script>";
    }
} else {
    include 'common/smarty.php';

    $tpl->display("made.html");
}



?>
